// 生成flutter listview
function listviewCode(cache) {
    cache.children.sort((a, b) => a.data.x - b.data.x);

    let first = cache.children[0];
    let direction = 'Axis.horizontal';
    for (var i = 1; i < cache.children.length; i++) {
        var child = cache.children[i];
        if (first.data.x + first.data.width >= child.data.x) {
            direction = 'Axis.vertical';
            break;
        }
        first = child;
    }

    let childCode = doExport(first);

    var code = `
        ListView.builder(
          itemCount: 0,
          scrollDirection: ${direction},
          itemBuilder: (BuildContext context, int index) {
            return ${childCode};
          },
        )
    `;

    return code;
}